package com.ynnz.service.impl;

import com.ynnz.dao.CustomerDao;
import com.ynnz.pojo.Customer;
import com.ynnz.service.CustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @Title: CustomerServiceImpl
 * @Description:
 * @PACKAGE_NAME：com.ynnz.service.impl
 * @Author: 94358 fangjinsen
 * CreateDate: 2022/5/9 9:17
 */
@Component("customerService")
public class CustomerServiceImpl implements CustomerService {
    //获取CustomerDao对象
    @Autowired
    private CustomerDao customerDao;

    /**
     * 新增
     *
     * @param customer
     * @return
     */
    @Override
    public int insertCustomer(Customer customer) {
        return customerDao.insertCustomer(customer);
    }

    /**
     * 删除
     *
     * @param customerId
     * @return
     */
    @Override
    public int deleteCustomer(int customerId) {
        return customerDao.deleteCustomer(customerId);
    }

    /**
     * 更新
     *
     * @param customer
     * @return
     */
    @Override
    public int updateCustomer(Customer customer) {
        return customerDao.updateCustomer(customer);
    }

    //查询测试
    @Override
    public List<Customer> queryCustomer() {
        return customerDao.queryCustomer();
    }

    /**
     * 多信息查询
     *
     * @param customer
     * @param begin
     * @param size
     * @return
     */
    @Override
    public List<Customer> queryCust(Customer customer, int begin, int size) {
        return customerDao.queryCust(customer,begin,size);
    }
}
